package com.axxc.jpa.pattendegign.commons;

import java.lang.reflect.Proxy;

import com.axxc.jpa.pattendegign.proxy.Dish;
import com.axxc.jpa.pattendegign.proxy.DishProxy;
import com.axxc.jpa.pattendegign.proxy.DishSubclass;

/**
 * @ClassName TestProxy
 * @Description //TODO 请描述该类的作用
 * @author xxc
 * @data 2018年9月16日上午12:00:46
 * @see {@link http://gitee.com/biuabiu/ }
 */
public class TestProxy {

	public static void main(String[] args)
			throws ClassNotFoundException, InstantiationException, IllegalAccessException {

		Dish dishSubclass = new DishSubclass();
		Class<?> clazz = Class.forName("com.axxc.jpa.pattendegign.proxy.DishSubclass");
		DishProxy dishProxy = new DishProxy(dishSubclass);
		Dish newProxyInstance = (Dish) Proxy.newProxyInstance(clazz.getClassLoader(), clazz.getInterfaces(), dishProxy);
		newProxyInstance.syso("AAAAAAAAAAAAAAA");

	}
}
